﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.ServiceModel;

namespace _013_WCFStreamClient
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                string filename = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
                Server.IFileUploadContract srv = new Server.FileUploadContractClient();
                Server.FileUploadMessage msg = new Server.FileUploadMessage();

                using (FileStream fs = new FileStream(filename, FileMode.Open))
                {
                    msg.FileName = filename;
                    msg.FileByteStream = fs;


                    srv.UploadFile(msg);
                }
            }catch(Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
    }
}
